#include "LightDigitGroup.h"
#include "Delay.h"

uchar mapDigitGroup[10] = { 0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x07, 0x7F, 0x6F };
void LightDigitGroup(uchar index, uchar value) {
	if(value == -1) {
		P0 = 0;
	} else {
		P2_4 = (index >> 2) & 1;
		P2_3 = (index >> 1) & 1;
		P2_2 = index & 1;
		P0 = mapDigitGroup[value];
	}
}

void LightDigitGroupFast(uchar index, uchar value) {
	LightDigitGroup(index, value);
	Delay(1);
	LightDigitGroup(index, -1);
}